package com.mall.users.controller;

import com.mall.commons.utils.CommonResult;
import com.mall.users.service.UmsMemberLevelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/memberLevel")
public class UmsMemberLevelController {

    @Autowired
    private UmsMemberLevelService umsMemberLevelService;

    /**
     * 查询所有会员等级
     *
     * @return
     */
    @GetMapping("/list")
    public CommonResult list(Integer defaultStatus) {
        log.info("defaultStatus：{}", defaultStatus);
        List resultList = umsMemberLevelService.list(defaultStatus);
        return CommonResult.success(resultList);
    }

}
